find -exec
Linux (GNU)、macOS (BSD) だけで動けばよいのであれば find -print0 | xargs -0 の方が良い
例 -exec grep -n --colour=auto 検索語 {} \;
-exec grep -n --colour=auto 検索語 {} + の方がよさそう
-exec utility [argument ...] ;
True if the program named utility returns a zero value as its exit status.
utilityとして渡したプログラムが終了コード0ならTrue
Optional arguments may be passed to the utility.
utilityの引数を取れる
The expression must be terminated by a semi-colon (;). If you invoke find from a shell you may need to quote the semicolon if the shell would otherwise treat it as a control operator.
セミコロンはシェルの制御文字として扱われないように文字列にする
リンクを貼ったQiitaでも言及されている(バックスラッシュでエスケープ)
If the string {} appears anywhere in the utility name or the arguments it is replaced by the pathname of the current file.
{} はパスに置換される
Utility will be executed from the directory from which find was executed.
Utility and arguments are not subject to the further expansion of shell patterns and constructs.
-exec utility [argument ...] {} +
Same as -exec, except that {} is replaced with as many pathnames as possible for each invocation of utility. This behaviour is similar to that of xargs(1).(強調引用者)